<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>

<div id="index">
    <img :src="url" :alt="title"><br>
    <input :type="typeStr" placeholder="请输入wifi密码"> <button @click="changeType">{{ tipStr }}</button>
</div>

<script>
    let vm = new Vue({
        el:"#index",

        data:{
          url:"#",
          title:"测试图片",
          typeStr:"password",
          tipStr:"显示密码",
        },

        methods: {
            //
            changeType(){
                // console.log("1")
                // console.log(this.typeStr)
                if (this.typeStr == "text") {
                    this.typeStr = "password"
                    this.tipStr = "显示密码"
                } else {
                    this.typeStr = "text"
                    this.tipStr = "隐藏密码"
                }
            }
        },
    })
</script>
</body>
</html>
